#!/usr/bin/expect
set timeout 30 
set ipaddr   [lindex $argv 0] 
set username [lindex $argv 1]
set password [lindex $argv 2]
set args     [lindex $argv 3]
#spawn  -noecho sshpass -p $password ssh $username@$ipaddr -o StrictHostKeyChecking=no  "sudo -S $args"
spawn  -noecho sshpass -p $password ssh $username@$ipaddr -o StrictHostKeyChecking=no  "$args"
interact

